#ifndef __AS_FILLED_AREA__H__
#define __AS_FILLED_AREA__H__

#include "ASControl.h"

typedef enum
{
    AS_FA_SHAPE_RECT,
    AS_FA_SHAPE_ROUNDRECT,
    AS_FA_SHAPE_TRIANGLE,
    AS_FA_SHAPE_CIRCLE,

    AS_FA_SHAPE_MAX
} as_filled_area_shape;


typedef struct
{
    /* base */
    as_control base;

    /* attributes */
    as_filled_area_shape shape;
    ASUINT fill_color;
    ASUINT frame_color;
    ASINT round_width;

    /* methods */

    /*
     *	[description] set the shape of this filled area
     *  [param] ctrl_p : which you want to change property
     *  [param] shape : special shape (enum as_filled_area_shape)
     *  [return] as_ret : AS_OK ,or error code
     */
    as_ret (*set_shape)(as_control* ctrl_p, as_filled_area_shape shape);

    /*
     *	[description] set color to fill this filled area
     *  [param] ctrl_p : which you want to change property
     *  [param] color : special color (0xrrggbb)
     *  [return] as_ret : AS_OK ,or error code
     */
    as_ret (*set_fill_color)(as_control* ctrl_p, ASUINT color);

    /*
     *	[description] set frame color of this filled area
     *  [param] ctrl_p : which you want to change property
     *  [param] color : special color (0xrrggbb)
     *  [return] as_ret : AS_OK ,or error code
     */
    as_ret (*set_frame_color)(as_control* ctrl_p, ASUINT color);

    /*
     *	[description] set round width of this filled area , just for round rectangle
     *  [param] ctrl_p : which you want to change property
     *  [param] width : width of roundrect
     *  [return] as_ret : AS_OK ,or error code
     */
    as_ret (*set_round_width)(as_control* ctrl_p, ASINT width);

} as_filled_area;

/*
 *	[description] create a filled area control
 *  [param] paint_buf : display buffer
 *  [param] area : area of this control
 *  [return] as_filled_area* : if NULL , means create failed.
 *                       else return the pointer of filled area.
 */
as_filled_area* as_ctrl_filledarea_create(as_rect area);

/*
 *	[description] destroy a existed filled area
 *  [param] ctrl_filledarea_p : pointer of filled area control
 *  [return] as_ret : AS_OK means destroy successful,else are abnormal.
 */
as_ret as_ctrl_filledarea_destroy(as_filled_area* ctrl_filledarea_p);

#endif//__AS_FILLED_AREA__H__